package org.martin.snsrs.crawler;

import java.util.LinkedList;

public class MyList {
	
	private LinkedList<String> list;
	
	private static MyList myList;
	
	private Object motex;
	
	public static MyList getInstance(){
		if(myList == null)
			myList = new MyList();
		return myList;
	}
	
	private MyList(){
		list = new LinkedList<String>();
		motex = new Object();
	}
	
	public void add(String element){
		synchronized (motex) {
			list.add(element);
		}
	}
	
	public boolean contains(String e){
		synchronized (motex) {
			for(String t : list){
				if(t.equals(e))
					return true;
			}
			return false;
		}
	}

}
